package edu.uic.kott.activities;

import edu.uic.keyoutcomestrackertool.R;
import edu.uic.kott.fragments.FragmentCalendarView;
import edu.uic.kott.fragments.TrackActivities;
import edu.uic.kott.fragments.TrackAttendance;
import edu.uic.kott.fragments.TrackOptions;
import edu.uic.kott.fragments.TrackStudySessions;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
import android.app.FragmentManager;


public class TrackKeyOutcomes extends FragmentActivity{
	
	public static String activeDate;
	public static String attendanceFragment;
	public static Boolean attendanceVisible = false;
	public static Boolean studySessionsVisible = false;
	public static Boolean activitiesVisible = false;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.track_key_outcomes);
		
		//FragmentCalendarView calendarView = new FragmentCalendarView();
		TrackOptions trackOptions = new TrackOptions();
		
		FragmentManager fragmentManager = getFragmentManager();
		FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
		fragmentTransaction.add(R.id.track_view, trackOptions, "trackOptions");
		fragmentTransaction.addToBackStack("trackOptions");
		fragmentTransaction.commit();

		activeDate = FragmentCalendarView.date_focused;
	}
	
	public static void UpdateVariables() {
		activeDate = FragmentCalendarView.date_focused;
		Log.i("Date", activeDate);
		
		if (attendanceVisible == true) {
			TrackAttendance.AttendanceUpdateOnDateChange();
		}
		else if (studySessionsVisible == true) {
			TrackStudySessions.StudySessionsUpdateOnDateChange();
		}
		else if (activitiesVisible == true) {
			Log.i("activitiesVisible", String.valueOf(activitiesVisible));
			TrackActivities.ActivitiesUpdateOnDateChange();
		}
	}
}
